/* IP (Layer 3 only) public interface */

/* Copyright (C) 2009-2011 David Zanetti
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License along
 *  with this program; if not, write to the Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */


/* process an IP packet */
uint8_t ip_process(uint8_t slot);

void ip_init(void);
void ip_update(uint8_t a, uint8_t b, uint8_t c, uint8_t d);
void ip_printaddr(uint8_t *x);

#define HTONS(x) ((x >> 8) | ((x & 0xff) << 8))

void ip_eeprom_init(void);

/* send to a specific IP address. Note: this uses the ARP layer if it cannot resolve the IP address to a MAC address */
uint8_t ip_send(uint8_t *dest_ip, uint8_t slot, uint8_t protocol);

